package com.easy.project.controller.system;

import com.easy.project.base.result.BizResult;
import com.easy.project.domain.dto.system.UserRoleDTO;
import com.easy.project.service.system.ISysUserRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 系统用户角色关联表 前端控制器
 * </p>
 *
 * @author wxz
 * @since 2024-01-10
 */
@RestController
@RequestMapping("/sys-user-role-po")
@Api(tags = "系统管理-用户和角色关系")
public class SysUserRoleController {

    @Resource
    private ISysUserRoleService sysUserRoleService;

    @PostMapping("/user/role")
    @ApiOperation(value = "用户和角色关联")
    public BizResult<Void> userRole(@Validated UserRoleDTO userRoleDTO){
        sysUserRoleService.userRole(userRoleDTO);
        return BizResult.success();
    }

}
